import java.rmi.*;


public class TimeServiceClient {
	
	public static void main(String[] args) {
		
		try {
			String host = "localhost";
			String port = "1099";
			String srv = "TimeService";
			String url = "rmi://" + host + ":" + port + "/" + srv;
			System.out.println("Looking-up TimeService " + url);
			TimeService ts = (TimeService)Naming.lookup(url);
			System.out.println(" Server time is " + ts.getTime());
		} catch (Exception e) {
			System.err.println(e.toString());
			System.exit(1);
		}
	}
}